package cn.net.xyan.tts.utils;

import cn.net.xyan.tts.api.ISynthesizer;
import cn.net.xyan.tts.mac.NSSpeechSynthesizer;
import cn.net.xyan.tts.sapi.Synthesizer;
import org.scijava.nativelib.NativeLibraryUtil;

/**
 * Created by zarra on 2017/1/26.
 */
public class TTSFactory {
    static public ISynthesizer createISynthesizer(){
        NativeLibraryUtil.Architecture arch = NativeLibraryUtil.getArchitecture();
        ISynthesizer result = null;
        if (arch == NativeLibraryUtil.Architecture.WINDOWS_32 || arch == NativeLibraryUtil.Architecture.WINDOWS_64) {
            result = new Synthesizer();
        }
        else if(arch == NativeLibraryUtil.Architecture.OSX_64){
            result = new NSSpeechSynthesizer();
        }

        return result;

    }
}
